class Person {
  late String name;
  late int age;

  Person(this.name, this.age);

// 具名构造函数
  Person.now() {
    print('Person.now 具名构造函数');
  }
// 具名构造函数
  Person.setInfo(this.name, this.age);

  void getUserInfo() {
    print("${this.name}---${this.age} ");
  }
}

void main() {
  Person p3 = new Person.now();
  Person p4 = new Person.setInfo('王五', 50);
  p4.getUserInfo();
}
